﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Core.EntityClient;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.Migrations;
using System.Data.Entity.Spatial;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Framework.Migrations;
using Loans.Domain;


namespace Loans.Test
{
    /// <summary>
    /// </summary>
    class Program
    {
        private static string constr;

        /// <summary>
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            constr = "LoansDbCe";
            // Botstraper auto migration 
            var migrator = new Migrator<LoansDb>(constr);

            // string connString = ConfigurationMananager.ConnectionStrings["name"].ConnectionString;
            
      //      AutoMigrateDatabase(constr);
      //     AppDomain.CurrentDomain.SetData("DataDirectory", Environment.CurrentDirectory);
      //     Console.Write(Environment.CurrentDirectory);

          //  EntityConnection con = new EntityConnection(constr);
         //   con.ChangeDatabase("aaa.sdf");

            using (var context = new LoansDb(constr))
            {
                // var initializer = new DropCreateDatabaseAlways<LoansDb>();
                // initializer.InitializeDatabase(context);
                // context.Configuration.AutoDetectChangesEnabled = true;
            }
        }
    }
}
